<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@page language="java" import="java.lang.*" %>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
	  <title>Category Administrator : Add Question</title>
	  <link rel="stylesheet" type="text/css" href="style.css" media="screen" />
  </head>
  
  <body>
  
	<jsp:include page="common/header.jsp"/>
  
	   <center><table>
         <html:form action="/jsp/AddQuestion.do">
			<b>The Question </b><br><br />
			<html:textarea property="question" value="<%=request.getParameter("question")%>"></html:textarea><br /><br />
			<br/><br/>
			<b>Enter the Answer and Check the correct option </b><br /><br />
			
<% 
			int numb = Integer.parseInt (request.getParameter ("number"));

			for (int i = 0; i < numb; i++)
			{
%>
				<html:textarea property="optionsArr"></html:textarea>
				
				<b><%=i+1%></b>
				
				<html:radio property="correctAnswer" value="<%=Integer.toString(i+1)%>"/><br />
<%  
			}
			if (request.getParameter("explanation") != null)
			{
%>
		
				<br/><br/>
				<br/><b>Explanation <br /><br />
				<html:textarea property="explanation"></html:textarea><br /><br />
<% 
			}

%>
			<br /><br />
		   	<b>Marks For Correct Answer</b>
		   	<html:text property="correctMarks" size="3" value="1"/>
		   	<br /><br />
			<b>Marks For Wrong Answer</b>
			<html:text property="wrongMarks" size="3" value="-1"/>
			<br/><br /><br />
			<html:submit />
		</html:form>
	  </table></center>

	  <jsp:include page="common/footer.jsp"/>

</body>
</html>
